﻿namespace BattleShip
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;

    public class Render
    {
        private int distanceFromWall;

        public Render(Player player)
        {
            if (player == Player.Human)
            {
                distanceFromWall = 42;
            }
            else
            {
                distanceFromWall = 2;
            }
        }

        public void Draw(int x, int y, char symbol, ConsoleColor color = ConsoleColor.Red)
        {
            int realXCoordinate = (x * 3) + distanceFromWall;
            int realYCoordinate = (y * 2) + 2;
            Console.ForegroundColor = color;
            Console.SetCursorPosition(realXCoordinate, realYCoordinate);
            Console.Write(symbol);
            Console.SetCursorPosition(realXCoordinate + 1, realYCoordinate);
            Console.Write(symbol);
            Console.SetCursorPosition(realXCoordinate + 1, realYCoordinate + 1);
            Console.Write(symbol);
            Console.SetCursorPosition(realXCoordinate, realYCoordinate + 1);
            Console.Write(symbol);
            Console.SetCursorPosition((x * 3) + distanceFromWall, (y * 2) + 2);
        }
    }
}